package org.jeecg.modules.mobile.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.basic.warehouse.entity.WmsBasicWarehouseArea;
import org.jeecg.modules.business.repertory.entity.WmsRepertory;
import org.jeecg.modules.mobile.service.IMobileMoveReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* @Description: 移动端-移库
* @Author: jeecg-boot
* @Date:   2023-09-21
* @Version: V1.0
*/
@Api(tags="移动端-移库")
@RestController
@RequestMapping("/mobile/move")
@Slf4j
public class MobileMoveReceiptController {

    @Autowired
    private IMobileMoveReceiptService moveReceiptService;

    /**
     * 扫描物料条码或者库区/库位，查询即时库存
     */
    @ApiOperation(value = "扫描物料条码或者库区/库位，查询即时库存", notes = "扫描物料条码或者库区/库位，查询即时库存")
    @GetMapping("/queryMaterial")
    public Result<List<WmsRepertory>> queryMaterial(@ApiParam("扫描名称") String name, @ApiParam("仓库id") String warehouseId) {
        return Result.OK(moveReceiptService.queryMaterial(name, warehouseId));
    }

    /**
     * 备料/退料区域库区
     */
    @ApiOperation(value = "备料/退料区域库区", notes = "备料/退料区域库区")
    @GetMapping("/getMaterialArea")
    public Result<WmsBasicWarehouseArea> getMaterialArea(@ApiParam("仓库id") String warehouseId,
                                                         @ApiParam("移库单id") String id) {
        return Result.OK(moveReceiptService.getMaterialArea(warehouseId, id));
    }

}
